/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.src.ptit.javatraining.huynh.btvn1;

import java.util.Scanner;

/**
 *
 * @author user
 */
public class Lv2Bai2 {

    public static void main(String[] args) {
        int n;
        Scanner sc = new Scanner(System.in);
        try {
            n = sc.nextInt();
            Arrays a[] = new Arrays[n];
            int size = 0;
            for (int i = 0; i < a.length; i++) {
                int n1;
                n1 = sc.nextInt();
                if (i == 0) {
                    a[size] = new Arrays();
                    a[size].number = n1;
                } else {
                    int ok = 0;
                    for (int j = size; j >= 0; j--) {
                        if (a[j].number == n1) {
                            a[j].solan++;
                            ok = 1;
                        }
                    }
                    if (ok == 0) {
                        size++;
                        a[size] = new Arrays();
                        a[size].number = n1;
                    }
                }
            }
            for (int i = 0; i <= size; i++) {
                System.out.println(a[i].number + " xuất hiện  " + a[i].solan + " lần.");
            }
        } catch (Exception e) {
            System.out.println("Moi nhap lai !");
        }
    }
}
